cssstyle: Handle 0 timestamp to mean "don't animate"
authorBenjamin Otte <otte@redhat.com>
Fri, 20 Feb 2015 23:15:04 +0000 (00:15 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 18 Mar 2015 14:23:32 +0000 (15:23 +0100)
gtk/gtkcssanimatedstyle.c

index 4583d8cc71745251fee78694f5cf99a4a1f7634b..6e845f689eb87edfecf9b7eb43fe7f4ed261582e 100644 (file)
@@ -410,6 +410,9 @@ gtk_css_animated_style_new (GtkCssStyle             *base_style,
   gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
   gtk_internal_return_val_if_fail (previous_style == NULL || GTK_IS_CSS_STYLE (previous_style), NULL);
 
+  if (timestamp == 0)
+    return g_object_ref (base_style);
+
   animations = NULL;
 
   if (previous_style != NULL)
@@ -441,6 +444,9 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
   gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
   gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base), NULL);
   
+  if (timestamp == 0)
+    return g_object_ref (source->style);
+
   animations = NULL;
   for (l = source->animations; l; l = l->next)
     {